package eleventh.Arrays类;

import java.util.Arrays;

public class 操作Arrays类的常用方法 {
    public static void main(String[] args) {
        int[]  temp = {1,2,5,2,9,4,3,7,23};
        Arrays.sort(temp);//数组排序
        System.out.println("排序后的数组："+Arrays.toString(temp));

        int point =Arrays.binarySearch(temp,9);
        System.out.println("元素9的位置在："+Arrays.binarySearch(temp,9));

        Arrays.fill(temp,3);//填充数组   数组填充：[3, 3, 3, 3, 3, 3, 3, 3, 3]
        System.out.println("数组填充："+Arrays.toString(temp));
    }
}
